/*
 * @Author: Seon.Hu SeonHu@126.com
 * @Date: 2023-09-04 15:21:41
 * @LastEditors: Seon.Hu SeonHu@126.com
 * @LastEditTime: 2024-02-04 11:23:43
 * @FilePath: \bg-vben\src\views\iot\rpclog\rpclog.data.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { AdColumn } from '@/components/AdVxeTable';
import { useI18n } from '@/hooks/web/useI18n';

const { t } = useI18n();

export const columns: AdColumn[] = [
  {
    title: t('entity.idTitle'),
    field: 'Id',
    width: 180,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'integer',
  },
  {
    title: t('iot.route.gateway.connectLog.clientIdText'),
    field: 'ClientId',
    width: 200,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'string',
  },
  {
    title: t('iot.route.gateway.connectLog.endpointText'),
    field: 'Endpoint',
    width: 150,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'string',
  },
  {
    title: t('iot.route.gateway.connectLog.ipText'),
    field: 'Ip',
    width: 150,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'string',
  },
  {
    title: t('iot.route.gateway.connectLog.identityText'),
    field: 'Identity',
    width: 120,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'string',
  },
  {
    title: t('iot.route.gateway.connectLog.succeededText'),
    field: 'Succeeded',
    width: 100,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'boolean',
    sortable: true,
  },
  {
    title: t('iot.route.gateway.connectLog.statusText'),
    field: 'Status',
    width: 180,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'string',
  },
  {
    title: t('iot.route.gateway.connectLog.messageText'),
    field: 'Message',
    width: 300,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'text',
    formCustomer: {
      colProps: {
        // span: 24,
        xs: 24, // <576px
        sm: 24, // ≥576px
        md: 24, // ≥768px
        lg: 24, // ≥992px
        xl: 24, // ≥1200px
        xxl: 24, // ≥1600px
        // xxxl: 24, // ≥2000px 3.0
      },
    },
  },
  {
    title: t('iot.route.gateway.connectLog.gatewayIdText'),
    field: 'GatewayId',
    width: 150,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'integer',
  },
  {
    title: t('iot.route.gateway.connectLog.gatewayNameText'),
    field: 'GatewayName',
    width: 200,
    formVisible: true,
    formEditable: false,
    filterable: true,
    filterIndex: 'Gateway.Name',
    dataType: 'string',
  },
  {
    title: t('iot.route.rpcLog.createdTimeText'),
    field: 'CreatedTime',
    width: 180,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'datetime',
  },
];
